package sheshen.come.cn.sheshen.mine;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import sheshen.come.cn.sheshen.MyApplication;
import sheshen.come.cn.sheshen.R;
import sheshen.come.cn.sheshen.base.BaseFragment;
import sheshen.come.cn.sheshen.been.User;
import sheshen.come.cn.sheshen.feature.adapter.MineAdapter;
import sheshen.come.cn.sheshen.navigation.imp.DefaultNavigation;

/**
 * Created by MyPC on 2017/2/17.
 */

public class MineFragment extends BaseFragment {
    @Override
    protected View getContentView(LayoutInflater inflater, ViewGroup container) {
        return inflater.inflate(R.layout.fragment_mine,container,false);
    }

    private ListView lv;
    private MineAdapter adapter;
    @Override
    protected void initViews(View contentView) {
        initNavigation(contentView);
        lv = (ListView) contentView.findViewById(R.id.lv);
        adapter = new MineAdapter(getContext(),null);
        lv.setAdapter(adapter);
    }

    private void initNavigation(View viewContent){
        DefaultNavigation.Builder builder = new DefaultNavigation.Builder(getContext(),(ViewGroup) viewContent);
        builder.setCenterText("我的").create().createAndBind();

    }

    @Override
    protected void initListeners() {

    }

    @Override
    protected void initDatas() {
        User user = MyApplication.getContext().getUser();
        adapter.append(user.getDate());
    }
}
